import { useReducer } from 'react';
import Setting from '../Setting';
import Preview from '../Preview';
import styles from '../index.less';
import reducer from '../reducer';
const Wrapper = () => {

  const qrcodeInfo = {
    background: { r: 255, g: 255, b: 255 },
    foreground: { r: 0, g: 0, b: 0 },
    text: '',
    textType: 'url',
  };
  const [state, dispatch] = useReducer(reducer, { ...qrcodeInfo });

  return (
    <div className={styles.Wrapper}>
      <Setting state={state} dispatch={dispatch} />
      <Preview state={state} />
    </div>
  );
};

export default Wrapper;
